package app.service.impl;

import app.domain.VisitLog;
import app.mapper.VisitLogMapper;
import app.service.VisitLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.stereotype.Service;

import java.net.InetAddress;
import java.util.Date;

/**
 * @author Administrator
 * @description 针对表【visit_log】的数据库操作Service实现
 * @createDate 2025-04-29 13:30:20
 */
@Service
public class VisitLogServiceImpl extends ServiceImpl<VisitLogMapper, VisitLog>
        implements VisitLogService {
    @Autowired
    private ServerProperties serverProperties;
    public int insertAcount(String threadName) {
        VisitLog visitLog = new VisitLog();
        visitLog.setAccount(threadName);
        visitLog.setVisitTime(new Date());
        try {
String  port=serverProperties.getPort().toString();
            visitLog.setServer((port));
        } catch (Exception e) {
        }
        return getBaseMapper().insert(visitLog);
    }
}




